package com.cloud.cmt.usermanage.entity.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.cloud.cmt.usermanage.constant.EnterpriseConstants;
import com.cloud.cmt.usermanage.dao.EnterpriseDetailDAO;
import com.cloud.cmt.usermanage.dao.EnterpriseUserDAO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2017<br>
 * 说明: 审核详情VO<br>
 * 项目名称: cloud-maintenance <br>
 * 创建日期: 2017年10月29日 14:56 <br>
 * 作者: <a href="6492178@gmail.com">汪萌萌</a>
 */
@Data
@NoArgsConstructor
@ApiModel
public class AuditDetailVO {

    @JSONField(name = "user_code")
    @ApiModelProperty(value = "会员编号", example = "123456789876543210")
    private String userCode;

    @JSONField(name = "social_credit_code")
    @ApiModelProperty(value = "社会信用代码", example = "123456789876543210")
    private String socialCreditCode;

    @JSONField(name = "industry")
    @ApiModelProperty(value = "行业类型(1:酒店,2:物业)", example = "1")
    private String industry;

    @JSONField(name = "enterprise_nature")
    @ApiModelProperty(value = "企业性质(1:独立经营,2:连锁经营)", example = "1")
    private String enterpriseNature;

    @JSONField(name = "enterprise_name")
    @ApiModelProperty(value = "企业名称", example = "华住酒店集团")
    private String enterpriseName;

    @JSONField(name = "enterprise_province")
    @ApiModelProperty(value = "企业省份", example = "")
    private String enterpriseProvince;

    @JSONField(name = "enterprise_city")
    @ApiModelProperty(value = "企业市份", example = "05")
    private String enterpriseCity;

    @JSONField(name = "enterprise_county")
    @ApiModelProperty(value = "企业区县", example = "01")
    private String enterpriseCounty;

    @JSONField(name = "enterprise_street")
    @ApiModelProperty(value = "企业街道门牌号", example = "虹桥路2266号")
    private String enterpriseStreet;

    @JSONField(name = "organization_name")
    @ApiModelProperty(value = "机构名称", example = "汉庭酒店(武林广场店)")
    private String organizationName;

    @JSONField(name = "hotel_star")
    @ApiModelProperty(value = "酒店星级(1-6)", example = "1")
    private Integer hotelStar;

    @JSONField(name = "organization_province")
    @ApiModelProperty(value = "机构省份", example = "02")
    private String organizationProvince;

    @JSONField(name = "organization_city")
    @ApiModelProperty(value = "机构市份", example = "04")
    private String organizationCity;

    @JSONField(name = "organization_county")
    @ApiModelProperty(value = "机构区县", example = "06")
    private String organizationCounty;

    @JSONField(name = "organization_street")
    @ApiModelProperty(value = "机构街道门牌号", example = "体育场路426号")
    private String organizationStreet;

    @ApiModelProperty(value = "联系人", example = "王哲")
    private String contact;

    @ApiModelProperty(value = "邮箱", example = "1048808795@qq.com")
    private String email;

    @JSONField(name = "business_license")
    @ApiModelProperty(value = "营业执照", example = "http://www.baidu.com/a.jpg")
    private String businessLicense;

    @ApiModelProperty(value = "电话", example = "13838384384")
    private String phone;
    @ApiModelProperty(value = "推荐人", example = "王哲")
    private String referrer;
    @ApiModelProperty(value = "用户名", example = "wzgrd")
    private String username;
    @ApiModelProperty(value = "密码", example = "##########")
    private String password;
    @ApiModelProperty(value = "账户状态", example = "使用中")
    private String accountStatus;
    @ApiModelProperty(value = "是否启用", example = "true")
    private Boolean enable;

    /**
     * Instantiates a new Audit detail vo.
     *
     * @param detailDAO the detail dao
     * @param userDAO   the user dao
     * @param referrer  the referrer
     */
    public AuditDetailVO(EnterpriseDetailDAO detailDAO, EnterpriseUserDAO userDAO, String referrer) {
        this.userCode = detailDAO.getUserCode();
        this.socialCreditCode = detailDAO.getSocialCreditCode();
        Integer industry = detailDAO.getIndustry();
        this.industry = EnterpriseConstants.getIndustryType(industry);
        Integer enterpriseNature = detailDAO.getEnterpriseNature();
        this.enterpriseNature = EnterpriseConstants.getEnterpriseType(enterpriseNature);
        this.enterpriseName = detailDAO.getEnterpriseName();
        this.enterpriseProvince = detailDAO.getEnterpriseProvince();
        this.enterpriseCity = detailDAO.getEnterpriseCity();
        this.enterpriseCounty = detailDAO.getEnterpriseCounty();
        this.enterpriseStreet = detailDAO.getEnterpriseStreet();
        this.organizationName = detailDAO.getOrganizationName();
        this.organizationProvince = detailDAO.getOrganizationProvince();
        this.organizationCity = detailDAO.getOrganizationCity();
        this.organizationCounty = detailDAO.getOrganizationCounty();
        this.organizationStreet = detailDAO.getOrganizationStreet();
        this.contact = detailDAO.getContact();
        this.email = detailDAO.getEmail();
        this.businessLicense = detailDAO.getBusinessLicense();
        this.phone = detailDAO.getPhone();
        this.referrer = referrer == null ? "无" : referrer;
        this.username = userDAO.getUsername();
        this.password = userDAO.getPassword();
        Integer accountStatus = userDAO.getAccountStatus();
        this.accountStatus = EnterpriseConstants.getAccountStatus(accountStatus);
        this.enable = userDAO.getEnable();

    }
}
